<include file="public:header"/>
<script language="javascript" type="text/javascript" src="__ROOT__/statics/js/jquery/plugins/formvalidator.js"></script>
<script language="javascript" type="text/javascript" src="__ROOT__/statics/js/jquery/plugins/formvalidatorregex.js"></script>
<link href="__ROOT__/statics/css/formvalidator.css" rel="stylesheet" type="text/css" />
<load href="__TMPL__public/css/account.css" />
<load href="__ROOT__/statics/js/dateselect.js" />
<load href="__ROOT__/statics/js/area.js" />
<div class="middle">
    <div class="uc_account ucontainers clearfix"> 
		<include file="account_left"/>
        <div class="right_region account">
			<present name="err">
            <div class="err"  style="width:150px;">
		        <div class="icon_{$err.err}">{$err.msg}</div>                
            </div>
            </present> 
            <form action="" method="post" name="myform" id="myform" enctype="multipart/form-data">
                <table>
                    <tr>
                        <th style="width:80px;" align="rihgt"><span class="required">*&nbsp;</span>会员帐号：</th>
                        <td><input type="text" name="name" id="name" value="{$user.name}" class="input_text"/></td>
                    </tr>
                    <tr>
                        <th><span class="required">*&nbsp;</span>电子邮箱：</th>
                        <td><input type="text" name="email" id="email" value="{$user.email}" class="input_text"/></td>
                    </tr>
                    <tr>
                        <th>会员头像：</th>
                        <td>
                            <if condition="trim($user['img']) neq ''">
                                <img src="{$user.img}" width="120" height="120"/><br>
                            <else/>
                                <img src="__TMPL__/public/images/avatar-60.png" width="40" height="40"/><br>
                            </if>                        	
                        	<input type="file"  name="img" id="img"/>    
                       	</td>
                    </tr>
                    <tr>
                        <th>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别：</th>
                        <td><input type="radio" name="sex" value="0"/>
                            男
                            <input type="radio" name="sex" value="1"/>
                            女
                            <input type="radio" name="sex" value="2"/>
                            保密 </td>
                    </tr>
                    <tr>
                        <th>出生年月：</th>
                        <td><select id="J_Year" name="year">
                            </select>
                            <select id="J_Month" name="month">
                            </select>
                            <select id="J_Day" name="day">
                            </select></td>
                    </tr>
                    <tr>
                        <th>所在城市：</th>
                        <td><select id="J_Province" name="province">
                            </select>
                            <select id="J_City" name="city">
                            </select></td>
                    </tr>
                    <tr>
                        <th>个人主页：</th>
                        <td><input type="text" name="blog" value="{$user.blog}" class="input_text"/></td>
                    </tr>
                    <tr>
                        <th>签名简介：</th>
                        <td><textarea style="width:300px;height:100px;" name="info">{$user.info}</textarea></td>
                    </tr>
                    <tr>
                        <th></th>
                        <td><input type="submit" class="submit" value="确定" name="dosubmit"/></td>
                    </tr>
                </table>
                <input type="hidden" name="id" value="{$user.id}"/>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
var sex=$.trim("{$user.sex|default='0'}");
var brithday=$.trim("{$user.brithday}");
var address=$.trim("{$user.address}");

$(function(){ 
		   
	/*
	setTimeout(function(){ 
		$('.err').fadeOut();
	},3000);
	*/
	$.formValidator.initConfig({formid:"myform",autotip:true,
		onerror:function(msg,obj){
			art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})
		}
	});
		
	$("#name").formValidator({onshow:"用户帐号不能为空",onfocus:"用户帐号不能为空"}).inputValidator({min:1,onerror:"用户帐号不能为空"});
	$("#email").formValidator({empty:false,onshow:"请填写邮箱",onfocus:"请填写邮箱"}).inputValidator({min:6,onerror:"请填写邮箱"}).regexValidator({regexp:"email",datatype:"enum",onerror:"邮件格式错误"});

	$("input[name='sex'][value='"+sex+"']").attr("checked","checked");
	//出生日期
	var year = 1985;
	var month = 1;
	var day = 1;	
	if(brithday != null){
	  	var bths = brithday.split("|");
	  	year = bths[0];
	  	month = bths[1];
	  	day = bths[2];
	}
	var ds = new DateSelector("J_Year", "J_Month", "J_Day", 
		{Year: year, Month: month, Day: day, MinYear: new Date().getFullYear() -100, MaxYear: new Date().getFullYear() });	
	//所在地
	var pro = "请选择";
	var city = "请选择";
	if(address != null){
	  var adds = address.split("|");
	  pro = adds[0];
	  city = adds[1];
	}
	setup(pro,city);	
	
});
</script>
<include file="public:footer"/> 